package Top200;

/**
 * @author zhangmin
 * @create 2022-02-24 15:56
 * x^(1/2)=(e^lnx)^(1/2)=e^((1/2)*lnx)
 */
public class mySqrt69 {
    public int mySqrt(int x) {
        if (x==0) return 0;
        int res= (int) Math.exp(0.5*Math.log(x));
        return (long)(res+1)*(res+1)<=x?res+1:res;
    }

}
